package com.jierui.meter.frontend.mapper;

import com.jierui.meter.frontend.domain.DO.TErrorComputingAndMeterDO;
import com.jierui.meter.frontend.domain.DO.TErrorComputingResultsDO;
import com.jierui.meter.frontend.domain.Param.ErrorComputingParam;
import com.jierui.meter.frontend.domain.Param.UniversalParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TErrorComputingMapper {

    List<TErrorComputingAndMeterDO> selectErrorAndMeter(@Param("calerror") String calerror, @Param("checkstatus") String checkstatus, @Param("orgInput") String orgInput,
                                                        @Param("idInput") String idInput, @Param("year") String year, @Param("scope") String scope, @Param("orgNo7") String orgNo7,
                                                        @Param("page") int page, @Param("size") int size);


    int selectErrorAndMeterCount(@Param("calerror") String calerror, @Param("checkstatus") String checkstatus, @Param("orgInput") String orgInput,
                                                        @Param("idInput") String idInput, @Param("year") String year, @Param("scope") String scope, @Param("orgNo7") String orgNo7);


    List<TErrorComputingResultsDO> selectByAlarmCodeDistinctMeterId(ErrorComputingParam param);

    int selectByAlarmCodeDistinctMeterIdCount(@Param("year") String year, @Param("orgNo") String orgNo);

    List<TErrorComputingResultsDO> selectByAlarmCodeDistinctTgId(ErrorComputingParam param);

    int selectByAlarmCodeDistinctTgIdCount(@Param("year") String year, @Param("orgNo") String orgNo);

    int selectAllErrorNumDistinctMeterId(@Param("year") String year, @Param("orgNo") String orgNo, @Param("orgNo7") String orgNo7);

    int selectAllErrorNumDistinctTgId(@Param("year") String year, @Param("orgNo") String orgNo, @Param("orgNo7") String orgNo7);

    List<TErrorComputingResultsDO> selectInvalidMeterNumByCityOrgName(@Param("year") String year, @Param("scope") String scope, @Param("orgNo7") String orgNo7, @Param("orgNoList") List<String> orgNoList);

    List<TErrorComputingResultsDO> selectInvalidMeterNumByTgIds(@Param("param") UniversalParam param);

    int selectTotalInvalid(@Param("year") String year, @Param("scope") String scope, @Param("orgNo") String orgNo);


    List<TErrorComputingAndMeterDO> selectByNameOrIdLike(@Param("year") String year, @Param("scope") String scope, @Param("orgNo7") String orgNo7,
                                                         @Param("orgInput") String orgInput, @Param("idInput") String idInput, @Param("page") int page, @Param("size") int size);

    int selectByNameOrIdLikeCount(@Param("year") String year, @Param("scope") String scope, @Param("orgNo7") String orgNo7,
                                                         @Param("orgInput") String orgInput, @Param("idInput") String idInput);


    List<TErrorComputingResultsDO> selectErrorEGroupByErrorE(@Param("tgId") String tgId);


    List<TErrorComputingResultsDO> gerErrorInfoByMeteridOrTgId(@Param("meterid") String meterid, @Param("tgId") String tgId,
                                                               @Param("page") int page, @Param("size") int size, @Param("alarmCode") String alarmCode,
                                                               @Param("alarmTime") String alarmTime);

    int gerErrorInfoByMeteridOrTgIdCount(@Param("meterid") String meterid, @Param("tgId") String tgId, @Param("alarmCode") String alarmCode,
                                         @Param("alarmTime") String alarmTime);


    List<TErrorComputingResultsDO> getErrorByOrgNameLike(@Param("param") UniversalParam param);

    int getErrorNumByTgId(@Param("tgId") String tgId);

    List<String> selectErrorCodeByTgIdOrMeterId(@Param("startime") String startime, @Param("endtime") String endtime, @Param("tgId") String tgId, @Param("orgNo7") String orgNo7);


    List<TErrorComputingResultsDO> selectByAlarmCodeByTgId(@Param("startime") String startime, @Param("endtime") String endtime, @Param("tgId") String tgId, @Param("orgNo7") String orgNo7);

    List<TErrorComputingResultsDO> selectErrorNumGroupByON7(ErrorComputingParam param);

    List<TErrorComputingResultsDO> selectErrorNumGroupByON7DistinctTgid(ErrorComputingParam param);

    List<TErrorComputingResultsDO> selectByMeterIdOrderByTime(@Param("meterid") String meterid,@Param("startTime") String startTime, @Param("endTime") String endTime);

    List<TErrorComputingResultsDO> selectByTgId(@Param("tgId") String tgId);

    int selectByMeterIdOrderByTimeCount(@Param("meterid") String meterid);

    List<TErrorComputingResultsDO> selectByAlramCodeAndON7OrderByGenDate(@Param("alarmCode") String alarmCode, @Param("orgNo7") String orgNo7);




}
